package com.ithero.contentcenter.feignclient.fallback;

import com.ithero.contentcenter.domain.dto.user.UserAddBonseDTO;
import com.ithero.contentcenter.domain.dto.user.UserDTO;
import com.ithero.contentcenter.feignclient.UserCenterFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * UserCenterFeignClient限流降级实现
 */
@Slf4j
@Component
public class UserCenterFeignClientFallBack implements UserCenterFeignClient {

    @Override
    public UserDTO findById(Integer id) {
        log.warn("远程调用被限流/降级了！");
        UserDTO userDTO = new UserDTO();
        userDTO.setWxNickname("流控/降级返回的用户！");
        return userDTO;
    }

    @Override
    public UserDTO addBonus(UserAddBonseDTO userAddBonseDTO) {
        log.warn("远程调用被限流/降级了！");
        return null;
    }
}
